# _*_ coding:utf-8 _*_
import random
import string
a=string.ascii_letters+string.digits
with open("txt.txt","w+") as f1:
    for i in range(120000000):
        length=random.randint(6,20)
        key=random.sample(a,length)
        keys="".join(key)
        f1.write(keys)
        f1.write("\n")
print("文件创建成功")
def unm():
    with open("txt.txt","r") as f2:
        for i in f2:
            yield i
unm1=unm()
ls=[]
for i in unm1:
    ls.append(len(i))
print(f"文件中最长行的长度是:{max(ls)}")




